{% extends 'AnketaBundle::layout.html.twig' %}
{% import 'AnketaBundle:Statistics:displayQuestionMacro.html.twig' as questionMacro %}
{% import 'AnketaBundle:Statistics:displayTeacherResponseMacro.html.twig' as responseMacro %}
{% block title %}{{ section.title }}{% endblock %}
{% block navigation %}
    {{ menu.statistics.render(section.activeMenuItems)|raw }}
{% endblock %}
{% block content %}
    {% if section.headingVisible %}
        <h1>{{ section.title }}</h1>
    {% endif %}
    {% if section.preface is not null and section.preface is not empty %}
        <p>{{ section.preface }}</p>
    {% endif %}

    {{ responseMacro.displayResponses(responses, section) }}
    {% for result in results %}
        {% if not loop.first %}
            <hr />
        {% endif %}
        {{ questionMacro.displayResults(result, section.season) }}
    {% endfor %}

    {% set prevSection = section.previousSection %}
    {% if prevSection is not empty %}
        <hr />
        <h2>{{ trans('statistics.results.predchadzajuce_hodnotenie') }}</h2>
        <p>
            {{ trans('statistics.results.pozrite_si') }}
            <a href="{{ prevSection.statisticsPath }}">{{ trans('statistics.results.hodnotenie_pre_obdobie', {'%season%': prevSection.season.description }) }}</a>.
        </p>
    {% endif %}
{% endblock %}
